package net.keebook.webapp.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

import net.keebook.webapp.util.AccessRight;
import net.keebook.webapp.util.ExposableId;


@Entity
public class ShareRequest implements Serializable, ExposableId {
	private static final long serialVersionUID = -4926983295720308113L;
	
	@Id @GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long id;
	@ManyToOne
	private KeeBook keeBook;
	@Enumerated(EnumType.STRING)
	private AccessRight accessRight;
	@ManyToOne
	private User invitingUser;
	@Column(unique=true)
	private String exposableId;
	private Date creationDate;
	private String email;
	@Column(columnDefinition="TEXT")
	private String message;
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public KeeBook getKeeBook() {
		return keeBook;
	}
	public void setKeeBook(KeeBook keeBook) {
		this.keeBook = keeBook;
	}
	public AccessRight getAccessRight() {
		return accessRight;
	}
	public void setAccessRight(AccessRight accessRight) {
		this.accessRight = accessRight;
	}
	public User getInvitingUser() {
		return invitingUser;
	}
	public void setInvitingUser(User invitingUser) {
		this.invitingUser = invitingUser;
	}
	public String getExposableId() {
		return exposableId;
	}
	public void setExposableId(String exposableId) {
		this.exposableId = exposableId;
	}
	public Date getCreationDate() {
		return creationDate;
	}
	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
}
